<template>
  <div>
    <h2>明星讲师</h2>
    <el-row
      :gutter="20"
      style="margin-left: 39px; text-align: center; margin-bottom: 68px"
    >
      <el-col :span="4"
        ><el-input v-model="nameinput" placeholder="请输入教师姓名"
      /></el-col>
      <el-col :span="5"
        ><el-input v-model="phoneinput" placeholder="请输入教师电话"
      /></el-col>
      <el-col :span="11"></el-col>
      <el-col :span="3"
        ><el-button
          type="primary"
          style="width: 160px; height: 40px"
          @click="submit"
          >查询</el-button
        ></el-col
      >
      <el-col :span="1"></el-col>
    </el-row>
    <el-space wrap style="margin-left: 39px">
      <el-card
        v-for="i in mxjsdata.data"
        :key="i"
        class="box-card"
        style="width: 230px; height: 270px; position: relative"
      >
        <!-- <template #header> -->
        <div class="teaflex">
          <!-- <span>Card name</span> -->
          <img src="../../../assets/images/course/teacher1.png" alt="" />
          <div>
            <h2>{{ i.teacher }}</h2>
            <p>三件事看到那设计的那就是的那款记得那时</p>
          </div>
        </div>
        <el-button type="primary" class="phone" @click="phone"
          ><el-icon><phone /></el-icon>发起会话</el-button
        >
        <!-- </template> -->
        <div class="describe">
          <div></div>
          <div></div>
          <div></div>
        </div>
        <!-- <div class="hoverbox"><h2>教师详情</h2>
    <table>教师姓名</table><p></p>
    <table>性别</table><p></p>
    <table>课时时长</table><p></p>
    <table>教学科目</table><p></p>
    <table>身份证号</table><p></p>
    <table>计薪方式</table><p></p>
    <table>家庭住址</table><p></p>
    <img src="" alt=""> -->
        <!-- </div> -->
      </el-card>
    </el-space>
    <img
      src="../../../assets/images/course/phone.png"
      alt=""
      class="img"
      @click="img"
      :style="show"
    />
  </div>
</template>

<script>
import mxjsdata from "../../../mockjs/mxjsdata.js";
import { Phone } from "@element-plus/icons-vue";
// let newdata = this.mxjsdata.data;
export default {
  data() {
    return {
      mxjsdata,
      show: "display:none",
      nameinput: "",
      phoneinput: "",
      // newdata: ""
    };
  },
  methods: {
    submit() {
      if (this.nameinput !== "") {
        this.mxjsdata.data = mxjsdata.data.filter((value) => {
          if (value.teacher === this.nameinput) {
            return value;
          }
        });
      }
    },
    phone() {
      this.show = "display:block";
    },
    img() {
      this.show = "display:none";
    },
  },

  components: { phone: Phone },
};
</script>

<style lang="less" scoped>
h2 {
  margin-top: 18px;
  margin-left: 19px;
  margin-bottom: 40px;
  font-size: 18px;
}
.teaflex {
  display: flex;
  flex-direction: column;
  align-items: center;

  div {
    width: 180px;
    height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    h2 {
      margin: 15px auto;
    }
    p {
      font-size: 14px;
      font-family: "楷体";
    }
  }
}
.teaflex img {
  width: 84px;
  height: 84px;
}
.phone {
  position: absolute;
  left: 0;
  bottom: 10px;
}
.img {
  position: absolute;
  top: 40%;
  left: 40%;
}
.el-card {
  position: relative;
  .describe {
    cursor: pointer;
    height: 18px;
    width: 10px;

    position: absolute;
    top: 8px;
    right: 8px;
    div {
      margin-top: 2px;
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: #598cff;
    }
  }
}
.hoverbox {
  width: 400px;
  height: 400px;
  position: absolute;
  right: -20px;
  top: 0;
  z-index: 5;
  background-color: #ffffff;
}
</style>
